from selenium.webdriver.common.by import By

from DAY5.autoframe.common.base import Base


class LoginPage(Base):
    def input_username(self, username):
        self.send_keys(('name', 'username'), username)

    def input_passwora(self, password):
        self.send_keys(('name', 'password'), password)

    def remember(self):
        self.click(('id', 'remember'))

    def login(self):
        self.click((By.NAME, "submit"))


if __name__ == '__main__':
    login = LoginPage('chrome')
    login.get_url('http://139.129.26.163/user.php')
    login.max()
    login.input_username('wukefei')
    login.input_passwora('123456')
    login.remember()
    login.login()
    login.quit()